<template>
  <div class="mgdog">
     <img src="https://scpic.chinaz.net/files/pic/pic9/202003/zzpic23514.jpg" alt="">
     <p :style="{backgroundColor: colorstr}" @click="add">这是第一个四肢健全的内瑟斯</p>
  </div>
</template>

<script>
export default {
   data(){
     return{
      colorstr: ""
     }
     
   },
   methods:{
    add(){
      this.colorstr = `rgb(${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)})`
    }
  }
};
    
   
 
</script>

<style>
.mydog{
  width: 400px;
  border: 1px solid black;
  text-align: center;
  float: left;

}


</style>